<template>
	<div style="background: #F7F7F7">
		<div class="successtop">
			<div class="successpic">
				<img src="../../../src/assets/img/paysuccess.png" alt="">
			</div>
			<div class="success_order">
			 <p>订单编号：{{order_id}}</p>
			</div>
		</div>
		<div class="successbottom">
			<div @click="backindex()">返回首页</div>
			<div class="successactive" @click="stuindex()">前去学习</div>
		</div>
	</div>
</template>

<script>
	export default {
		name: "orderSuccess",
		data() {
			return {
				id:'',  //课程id
				type:'',  //1课程
				order_id:'',
			};
		},
		methods:{
			// 点击返回首页
			backindex(){
				this.$router.push({
				  path:'/'
				})
			},
			stuindex(){
				// this.$router.go(-2);
				var type = this.type;
				var id = this.id;
				if(type=='1'||type==1){
				    this.$router.push({
				   path:'/gkx',
				   query:{
				     id:id
				   }
				 })
				}else if(type=='2'||type==2){
				    this.$router.push({
				   path:'/x',
				   query:{
				     id:id
				   }
				 })
				}else if(type=='3'||type==3){
				   this.$router.push({
				   path:'/details',
				   query:{
				     id:id
				   }
				 })
				}
			}
		},
		mounted() {
			sessionStorage.setItem('tapfalse',true);
			var id = this.$route.query.id;
			var type = this.$route.query.type;
			var order_id = this.$route.query.order_id;
			this.id=id;
			this.type=type;   //1课程
			this.order_id=order_id;   //1订单编号
		}
	}
</script>

<style scoped="scoped">
.successtop{
	width: 100%;
	height: 3.87rem;
	position: relative;
}
.successpic{
	width: 100%;
	height: 3.87rem;
	position:absolute;
}
.successpic img{
	width: 100%;
	height: 100%;
}
.successtop .success_order{
	position: absolute;
	bottom: .76rem;
	color: #F8FCFF;
	font-size: .24rem;
	width: 100%;
}
.success_order p{
	text-align: center;
}
.successbottom{
	width: 5.62rem;
	margin: .63rem auto 0;
	display: flex;
	justify-content: space-between;
}
.successbottom div{
	width: 2.6rem;
	height: .7rem;
	text-align: center;
	line-height: .7rem;
	color: #999999;
	border: 1px solid #999999;
	font-size: .28rem;
	border-radius: .35rem;
}
.successbottom .successactive{
	color: #0287FF !important;
	border: 1px solid #0287FF !important;
}
</style>
